/*
 * $Id: sysapi_getcwd.c,v 1.3 2005-11-24 10:58:19 bacon Exp $
 */

#include <xp/bas/sysapi.h>
#include <xp/bas/locale.h>
#include <xp/bas/mstring.h>
#include <xp/bas/errno.h>

int xp_getcwd (xp_char_t* buf, xp_size_t size)
{
#ifdef _WIN32
	return -1;
#else

#ifdef XP_CHAR_IS_MCHAR
	return getcwd (buf, size);
#else
	xp_mchar_t path_mb[XP_PATH_MAX + 1];
	if (getcwd(path_mb, xp_countof(path_mb)) == XP_NULL) return -1;
	if (xp_mcstowcs_strict(path_mb, buf, size) == -1) return -1;
	return 0;
#endif

#endif
}

